home *** CD-ROM | disk | FTP | other *** search
- #ifndef __DAVESFABSAMPLES__
- #define __DAVESFABSAMPLES__
- /******************************************************************************\
- *
- * Apple Macintosh Developer Technical Support
- *
- * Main header file for the DavesFabSamples application
- *
- * Program: DavesFabSamples
- * File: DavesFabSamples.h
- *
- * by: Forrest Tanaka
- *
- * Copyright © 1988-1991 Apple Computer, Inc.
- * All rights reserved.
- *
- \******************************************************************************/
-
-
- /******************************************************************************\
- * Header Files
- \******************************************************************************/
-
- #ifndef __STANDARDFILE__
- #include <StandardFile.h>
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
-
- /******************************************************************************\
- * Constants
- \******************************************************************************/
-
- /* Alert types */
- #define kGenericAlert 0 /* Display a generic alert */
- #define kNoteAlert 1 /* Display the note alert */
- #define kCautionAlert 2 /* Display the caution alert */
- #define kStopAlert 3 /* Display the stop alert */
-
- /* Alert button options */
- #define rOKAlertID 6010 /* Resource ID of OK alert */
- #define rOKCancelAlertID 6011 /* Resource ID of OK/Cancel alert */
- #define rSaveAlertID 6012 /* Resource ID of Save/Cancel/Don’t Save alert */
-
- /* Memory error message constants */
- #define rMemErrMessages 1000 /* Resource ID of memory error msg STR# */
- #define kMemErrAppOpenMsg 1 /* Not enough memory to open application */
- #define kMemErrOpenDocMsg 2 /* Not enough memory to open a document */
-
- /* Resource error message constants */
- #define rResErrMessages 1001 /* Resource ID of resource err message STR# */
- #define kResErrAppDamageMsg 1 /* Application is damaged */
-
- /* Miscellaneous error message constants */
- #define rMiscErrMessages 1002 /* Resource ID of misc. error message STR# */
- #define kMiscErrUnknownMsg 1 /* Unknown error */
- #define kMiscErrNoQTMsg 2 /* QuickTime not available */
- #define kMiscQuickTimeMsg 3 /* Some sort of QuickTime error */
-
- /* File error message constants */
- #define rFileErrMessages 1003 /* Resource ID of file error message STR# */
- #define kFileErrDocOpenMsg 1 /* Document is already open elsewhere */
-
-
- /******************************************************************************\
- * Macros
- \******************************************************************************/
-
- #ifdef applec
- #define topLeft(r) (*((gxPoint *) &(r).top))
- #define botRight(r) (*((gxPoint *) &(r).bottom))
- #endif
-
- #define hiWord(a) ((short) (((unsigned long) a) >> 16L))
- #define loWord(a) ((short) ((unsigned long) a))
-
-
- /******************************************************************************\
- * Global Variables
- \******************************************************************************/
-
- extern Boolean gQuitting; /* True if user requested that app quit */
- extern Boolean gWereInFront; /* True if this application is frontmost */
- extern Boolean gFixMenus; /* True if menus need fixing */
- extern Boolean gHasAppleEvents; /* True if Apple Events implemented */
- extern Boolean gHasCoolSF; /* True if 7.0 Standard File available */
-
-
- /******************************************************************************\
- * DoQuit - Handle Quit request from the user
- *
- * When the user requests that this application should quit, DoQuit is called to
- * perform the Quit command. All open document windows and desk accessory
- * windows (only applicable before system software version 7.0) are closed and
- * the gQuitting global variable is set to true.
- \******************************************************************************/
-
- void DoQuit(void);
-
-
- /******************************************************************************\
- * DoUpdateEvt - Handle an update event for any window
- *
- * When an update event is received, DoUpdateEvt is called to handle the
- * redrawing of the window that caused the update event. DoUpdateEvt determines
- * the kind of window that needs updating and calls the routine that handles that
- * kind of window to draw it. The anEvent parameter contains the update event.
- \******************************************************************************/
-
- void DoUpdateEvt(
- EventRecord *anEvent);
-
-
- /******************************************************************************\
- * DoActivateEvt - Handle an activate event for any window
- *
- * DoActivateEvt is called when an active event is received for the window
- * specified by eventWind. becomingActive is TRUE if the window is becoming
- * activated. It’s FALSE if the window is becoming inactive.
- \******************************************************************************/
-
- void DoActivateEvt(
- WindowPtr eventWindow,
- Boolean becomingActive);
-
-
- /******************************************************************************\
- * ShowAlert - Show an alert
- *
- * This routine puts up a an alert with a specified message. alertType specifies
- * which kind of icon to display in the upper-left corner of the alert.
- * kGenericAlert specifies that no icon should be displayed. kNoteAlert
- * specifies that the note icon should be displayed. kCautionAlert specifies
- * that the caution icon should be displayed. kStopAlert specifies that the stop
- * icon should be displayed.
- *
- * buttonOption specifies what buttons should be offered. rOKAlertID specifies
- * that only an OK button should be offered. rOKCancelAlertID specifies that
- * both an OK and a Cancel button should be offered.
- *
- * messageClass specifies the STR# resource ID which contains the message to
- * display and messageIndex specifies the index (the first message is index 1)
- * into that STR# of the message to display.
- *
- * The alert window is placed into alert position on the screen containing most
- * of the window specified by parentWindow, or the main screen if parentWindow is
- * nil.
- \******************************************************************************/
-
- short ShowAlert(
- short alertType,
- short buttonOption,
- short messageClass,
- short messageIndex);
-
- #endif
-